package gota;

import java.io.*;
import gate.*;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try
		{
			GotaWrapper wrapper = new GotaWrapper();
            Gate.setGateHome(new File("C:\\Sun\\gate-5.1"));
            Gate.setUserConfigFile(new File("D:\\Projects\\EclipseWorkspace\\GOTA\\gate.xml"));
           
            Gate.init();
            wrapper.ShowGui();
            
            //Gate.getCreoleRegister().registerDirectories(
			//		new File("C:/Program Files/GATE-5.0/plugins/ANNIE/")
			//		.toURI()
			//		.toURL());
            
            File file = new File("D:\\Projects\\GOTA\\Source\\GOTA.Client.Test\\GotaConfig.xml");
            StringBuffer contents = new StringBuffer();
            BufferedReader reader = new BufferedReader(new FileReader(file));
            String text = null;
            
            while ((text = reader.readLine()) != null)
           	{
            	contents.append(text)
            	.append(System.getProperty("line.separator"));
            }
            
            reader.close();
            
            wrapper.ProcessRequest(contents.toString());

			
			//AnnotationSet annoSet = doc.getAnnotations();
			//Set hashSet = new HashSet();
			//hashSet.add("Location");
			//hashSet.add("Person");
			//hashSet.add("Organization");
			//AnnotationSet locs = annoSet.get(hashSet);
			//Iterator iter = locs.iterator();
			//Iterator iter = annoSet.iterator();
			//while(iter.hasNext()) {
			//	Annotation ann = (Annotation)iter.next();
			//	System.out.println(ann);
			//}
		}
		catch(Exception exc)
		{
			exc.printStackTrace();
		}

	}

}
